<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page isELIgnored="false" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>账号管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">融资机构名称</div>
                    <div class="field">
                        <input name="fundRasInsNm" id="fundRasInsNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="field">
                        <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>


<script type="text/javascript">
    var grid = null;
    $(function () {

        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/rfbase/fribaseinfo/initList.do?insSts=1&insUseCd=2',
            method : 'get',
            columns: [
                { display: '融资机构名称', name: 'fundRasInsNm', align:'center', width: 150,
                    render: function (rowdata, rowindex, value){
                        var h ='<a href="javascript:showDetail(';
                        h+="'"+rowdata.id+"'";
                        h+=')">'+rowdata.fundRasInsNm+'</a>';
                        return h;
                    }
                },
                { display: '机构缩写', name: 'insAbb', align:'center', width: 80 },
                { display: '机构状态', name: 'insStsNm', align:'center', width: 80 },
                { display: '融资机构用途', name: 'insUseCdNm', align:'center', width: 100 },
                { display: '授信状态', name: 'crStNm', align:'center', width: 100 },
                { display: '授信额度', name: 'crLmt',align:'right', width: 120,
                    render: function (rowdata, index, value) {
                        return '&yen;' + FormatMoney(rowdata.crLmt / 100);
                    }
                },
                { display: '操作', width: 60 , align:'center',
                    render: function (rowdata, rowindex, value){
                        var h='<a href="javascript:choose(';
                        h+="'"+rowdata.id+"',";
                        h+="'"+rowdata.fundRasInsNm+"'";
                        h+=')">选择</a>';
                        return h;
                    }
                },
            ],
            pageSize:10,
            checkbox: true,
            root:'rows',
            record:'total',
            hideLoadButton : true,
            width: '100%',
            height:'100%',
            heightDiff:-2,
            rownumbers:true,
            fixedCellHeight:false,
            /* isChecked: f_isChecked, onCheckRow: f_onCheckRow, onCheckAllRow: f_onCheckAllRow */
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        $("#searchBtn").click(function (event) {
            var form = new liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });


    });

    //查看详情
    function showDetail(_id){
        $.ligerDialog.SQopen({
            cls: 'noBorder_Dialog',
            width: 1000,
            height:450,
            title : '融资机构详情',
            url:'<%=path%>/rfbase/fribaseinfo/toDetailPage.do?id='+_id,
            // 自定义buttons的时候 不要设置 fixButtons: true
            buttons: [ {
                text: "关闭", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    function choose(id,nm){
        parent.$("#mgtOrgId").val(id);
        parent.$("#mgtOrgNm").val(nm);
        frameElement.dialog.close();
    }

</script>

</body>
</html>